﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System
{
    public static class StringExtends
    {
        /// <summary>
        /// 判断字符串 非空（null/empty/whitespace）
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static bool IsAvailable(this String value)
        {
            return !string.IsNullOrEmpty(value) && !string.IsNullOrWhiteSpace(value);
        }
        /// <summary>
        /// 去
        /// </summary>
        /// <param name="value"></param>
        /// <param name="trimValues"></param>
        /// <returns></returns>
        public static string Replace(this String value,string toValue,params string[] replaceValues)
        {
            foreach (var item in replaceValues)
            {
                value = value.Replace(item, "");
            }
            return value;
        }
    }
}
